<?php
session_start();

if (isset($_SESSION['ID'])) {
    $ID_LOGADO = $_SESSION['ID'];
    $PERMISSAO = $_SESSION['PERMISSAO'];
} else {
    $PERMISSAO = 0;
}
?>

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript">
            function validarSenha(form) {
                senha = document.formulario.SENHA1.value
                senhaRepetida = document.formulario.SENHA2.value
                if (senha != senhaRepetida) {
                    alert("Repita a senha corretamente");
                    document.formulario.SENHA2.focus();
                    return false;
                }
            }
            function voltar() {
<?php
if (isset($_SESSION['ID'])) {
    echo "window.location = 'visualizar_aluno.php';";
} else {
    echo "window.location = 'index.php';";
}
?>
            }
        </script>
        <link href="Styles/CSS.css" rel="stylesheet" type="text/css"/>
        <meta charset="UTF-8">
        <title>AGE - Cadastro de Aluno</title>
    </head>
    <body style="background-color: #9cea70"  onload="startTime()">
        <?php include("./cabecalho.html") ?>

        <table id="SITE">
            <tr>
                <?php
                if (isset($_SESSION['ID'])) {
                    $ID_LOGADO = $_SESSION['ID'];
                    $PERMISSAO = $_SESSION['PERMISSAO'];
                }
                    ?>
                    <td id="MENU" valign="top">
                        <?php include("./menuLateral.php") ?>
                    </td>
                    <?php
                ?>
                <td id="CONTEUDO">
                    <form name="formulario" action="operacoesPHP/registraInstituicao.php" method="POST"  enctype="multipart/form-data">
                        <h1> Adicionar Instituição </h1>
                        <table width="400" border="0">
                            <tr>
                                <td width="150px">Razão Social*:</td>
                                <td><input type="text" name="RAZAO" required></td>
                            </tr>
                            <tr>
                                <td>Endereço*:</td>
                                <td><input type="text" name="ENDERECO" required></td>
                            </tr>
                            <tr>
                                <td>Cidade*:</td>
                                <td><input type="text" name="CIDADE" required></td>
                            </tr>
                            <tr>
                                <td>Estado*:</td>
                                <td><input type="text" name="ESTADO" required></td>
                            </tr>
                            <tr>
                                <td>País*:</td>
                                <td><input type="text" name="PAIS" required></td>
                            </tr>
                            <tr>
                                <td>Website:</td>
                                <td><input type="url" name="SITE"></td>
                            </tr>
                            <tr>
                                <td><input type="submit" value="Cadastrar"></td>
                                <td><input type="button" value="Voltar" onclick="return voltar()"></td>
                            </tr>
                        </table>
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>